package com.example.alteroracle.pojo.po;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;


@Data
@TableName("STUDENTS")
public class Student {
    //创建序列
//    CREATE SEQUENCE seq_id
//    START WITH 1
//    INCREMENT BY 1
//    NOCACHE
//            NOCYCLE;
//
//  创建触发器 与表绑定
//    CREATE OR REPLACE TRIGGER trg_students_id
//    BEFORE INSERT ON students
//    FOR EACH ROW
//            BEGIN
//    IF :NEW.student_id IS NULL THEN
//    SELECT seq_id.NEXTVAL INTO :NEW.student_id FROM DUAL;
//    END IF;
//    END;

    //使用触发器为 student_id 生成自增主键  type = IdType.AUTO
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    private String name;
    private Integer age;
}
